package ai.mspbots.trace.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/users")
public class UserController {

    @GetMapping("/list")
    public List<String> getUsers(@RequestHeader(value = "X-B3-TraceId", required = false) String traceId) {
        // 使用 traceId 进行日志记录或其他业务逻辑
        System.out.println("Received traceId: " + traceId);
        return List.of("Alice", "Bob", "Charlie");
    }
}
